<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>KGC学生管理系统</title>
    <link rel="stylesheet" href="./layui/css/layui.css">
    <link rel="stylesheet" href="../css/common.css">
    <style>
        .container {
            height: 100vh;
            display: flex;
            flex-direction: column;
        }

        .header {
            height: 60px;
            background-color: #393D49;
        }

        .header .logo {
            font-size: 30px;
            color: #ffffff;
            padding: 20px;
        }

        .header .nav {
            padding-right: 20px;
        }

        .content {
            flex: 1;
        }

        .content .left {
            width: 200px;
            background-color: #393D49;
        }

        .content .right {
            padding-left: 10px;
            padding-top: 10px;
            flex: 1;
        }
        .content .right iframe{
            width: 100%;
            height: 100%;
        }

        .layui-form {
            margin-top: 10px;
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="header flex j-s a-c">
            <div class="logo">LOGO</div>
            <div class="nav">
                <ul class="layui-nav" lay-filter="">
                    <li class="layui-nav-item layui-this"><a href="javascript:void(0)">最新活动</a></li>
                    <li class="layui-nav-item"><a href="javascript:void(0)">产品</a></li>
                    <li class="layui-nav-item"><a href="javascript:void(0)">大数据</a></li>
                    <li class="layui-nav-item">
                        <a href="javascript:;" id="loginId">loginId</a>
                        <dl class="layui-nav-child">
                            <!-- 二级菜单 -->
                            <dd><a href="javascript:void(0)">个人信息</a></dd>
                            <dd><a href="javascript:void(0)">系统消息</a></dd>
                            <dd><a href="javascript:void(0)" id="exit">退出</a></dd>
                        </dl>
                    </li>
                </ul>
            </div>
        </div>
        <div class="content flex">
            <div class="left">
                <ul class="layui-nav layui-nav-tree" lay-filter="test">
                    <!-- 侧边导航: <ul class="layui-nav layui-nav-tree layui-nav-side"> -->
                    <li class="layui-nav-item layui-nav-itemed">
                        <a href="javascript:;">学生管理</a>
                        <dl class="layui-nav-child">
                            <dd><a href="./pages/students/add.html" target="right">添加学生</a></dd>
                            <dd><a href="./pages/students/list.html" target="right">查询学生</a></dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item">
                        <a href="javascript:;">课程管理</a>
                        <dl class="layui-nav-child">
                            <dd><a href="javascript:;">添加课程</a></dd>
                            <dd><a href="javascript:;">查询课程</a></dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item">
                        <a href="javascript:;">成绩管理</a>
                        <dl class="layui-nav-child">
                            <dd><a href="javascript:;">添加成绩</a></dd>
                            <dd><a href="javascript:;">查询成绩</a></dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item"><a href="">产品</a></li>
                    <li class="layui-nav-item"><a href="">大数据</a></li>
                </ul>
            </div>
            <div class="right">
                <iframe name="right" src="./pages/students/list.html" frameborder="no"></iframe>
            </div>
        </div>
    </div>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js"></script>
    <script src="./layui/layui.js"></script>
    <script>
        $(function () {
            //判断用户是否登录成功
            if ($.cookie('isLogin') === 'true') {
                $('#loginId').text($.cookie('loginId'))
            } else {
                //否则，跳转到登录页面
                location.href = './login.html'
            }
            //退出
            $('#exit').click(function(){
                //清除对应的cookie
                $.removeCookie('loginPwd')
                $.removeCookie('isck')
                $.removeCookie('isLogin')
                location.href='./login.html'
            })
        })

        //注意：导航 依赖 element 模块，否则无法进行功能性操作
        //laypage 是分页模块
        layui.use(['element', 'laypage', 'laytpl'], function () {
            //引入layui的模板引擎
            var laytpl = layui.laytpl;
            var element = layui.element;
            var laypage = layui.laypage;
        });

    </script>
</body>

</html>